'''
xadmin的例子：
import xadmin
from .models import Goods, GoodsCategory, GoodsImage, GoodsCategoryBrand, Banner, HotSearchWords
from .models import IndexAd

class GoodsAdmin(object):
    list_display = ["name", "click_num", "sold_num", "fav_num", "goods_num", "market_price",
                    "shop_price", "goods_brief", "goods_desc", "is_new", "is_hot", "add_time"]
    search_fields = ['name', ]
    list_editable = ["is_hot", ]
    list_filter = ["name", "click_num", "sold_num", "fav_num", "goods_num", "market_price",
                   "shop_price", "is_new", "is_hot", "add_time", "category__name"]
    style_fields = {"goods_desc": "ueditor"}


xadmin.site.register(Goods, GoodsAdmin)
xadmin.site.register(GoodsCategory, GoodsCategoryAdmin)

'''
import xadmin
from xadmin import views
from UShop.models import TbNews2

class newsadmin(object):
    list_display = ["news_title","news_time", "news_status",   "news_classify", "key_word", ]
    search_fields = ["news_time", "news_status", "news_title", "key_word"]
    list_filter = ["news_time", "news_status", "news_title", "key_word"]
    list_editable = [ "news_time", "news_status", "news_classify"]
    list_per_page = 20
    list_max_show_all = 20

class BaseSetting(object):
        enable_themes = True
        use_bootswatch = True


class GlobalSettings(object):
    site_title = "后台管理系统"
    site_footer = "无敌在线后台"
    # 左侧菜单栏收缩功能
    menu_style = "accordion"
    # 注册：


xadmin.site.register(views.CommAdminView, GlobalSettings)




xadmin.site.register(views.BaseAdminView, BaseSetting)


xadmin.site.register(TbNews2, newsadmin)